package com.cosina.game.robodefence.eventlistener;

import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.cosina.game.robodefence.R;
import com.cosina.game.robodefence.RoboDefenceActivity;

public class MainPageEventListener {

	public static void doReg(final RoboDefenceActivity acty) {
		{
			Button newGameBtn = (Button)acty.findViewById(R.id.newGame);
			newGameBtn.setOnClickListener(new OnClickListener() {
				
				@Override
				public void onClick(View v) {
					acty.setContentView(R.layout.level);
				}
			});
		}
		{
			Button resumeGameBtn = (Button)acty.findViewById(R.id.resumeGame);
			resumeGameBtn.setOnClickListener(new OnClickListener() {
				@Override
				public void onClick(View v) {
				}
			});
		}
		{
			Button viewAchievementsBtn = (Button)acty.findViewById(R.id.viewArchievements);
			viewAchievementsBtn.setOnClickListener(new OnClickListener() {
				@Override
				public void onClick(View v) {
					acty.setContentView(R.layout.achievements);
				}
			});
		}
		{
			Button spendRewardsBtn = (Button)acty.findViewById(R.id.spendRewards);
			spendRewardsBtn.setOnClickListener(new OnClickListener() {
				@Override
				public void onClick(View v) {
					acty.setContentView(R.layout.spendreward);
				}
			});
		}
		{
			Button creditsButton = (Button)acty.findViewById(R.id.credits);
			creditsButton.setOnClickListener(new OnClickListener() {
				@Override
				public void onClick(View v) {
					acty.setContentView(R.layout.credits);
				}
			});
		}
		{
			Button exitButton = (Button)acty.findViewById(R.id.exit);
			exitButton.setOnClickListener(new OnClickListener() {
				@Override
				public void onClick(View v) {
					acty.finish();
				}
			});
		}
	}
}
